package ch.ethz.fcl.metrobuzz.render.od.flow_view.interactions;

import java.awt.MenuItem;
import java.awt.PopupMenu;

import ch.ethz.fcl.metrobuzz.render.od.flow_view.ODFrame;
import ch.ethz.fcl.metrobuzz.render.od.flow_view.sankey.ODSankeyDiagramData;
import ch.ethz.fcl.metrobuzz.render.od.flow_view.sankey.SankeyNodeGroup;

public class ODPopupMenu extends PopupMenu {
	private static final long serialVersionUID = -3757633603867231887L;

	private ODFrame frame;
	private ODSankeyDiagramData data;

	private MenuItem menuItem;

	public static String HIGH_LIGHT = "High Light";
	public static String SHOW_TEMPORAL = "Show Distribution";
	public static String HIDE = "Hide";
	public static String RESET = "Reset";

	public boolean showDistribution = false;

	protected SankeyNodeGroup selectedGroup;

	public ODPopupMenu(ODFrame frame, ODSankeyDiagramData data) {
		this.frame = frame;
		this.data = data;

		ODPopupMenuActionListener al = new ODPopupMenuActionListener(
				this.frame, this);
		ODPopupMenuMouseListener ml = new ODPopupMenuMouseListener(this.data,
				this);

		add(menuItem = new MenuItem(HIGH_LIGHT));
		menuItem.addActionListener(al);
		addSeparator();

		add(menuItem = new MenuItem(HIDE));
		menuItem.addActionListener(al);
		addSeparator();

		add(menuItem = new MenuItem(RESET));
		menuItem.addActionListener(al);

		frame.getComponent().add(this);
		frame.getComponent().addMouseListener(ml);
	}
}
